public class Book extends LibraryItem{
    private boolean reserved;

    Book(String name){
        super(name);
        this.reserved =false;
    }

    Book(String name, boolean reserved){
        super(name);
        this.reserved= reserved;
    }

    public boolean isReserved() {
        return reserved;
    }

    public void reserve(){
        if(reserved)
            System.out.println("Sorry this book is already reserved.");
        else {
            this.reserved = true;
            System.out.println("Thank You! Enjoy the book.");
        }
    }

    public String toString(){
        return name;
    }
}
